package by.grsu.hdm.model.remotecontrol.impl;

import by.grsu.hdm.exception.EmptyTrackListException;
import by.grsu.hdm.model.ihomedevice.HomeDeviceStatus;
import by.grsu.hdm.model.ihomedevice.devices.MediaPlayer;
import by.grsu.hdm.model.remotecontrol.AbstractRemoteControl;

public class MediaPlayerRemoteControl extends AbstractRemoteControl {
	
	private MediaPlayer player;
	
	public MediaPlayerRemoteControl(MediaPlayer player){
		this.player = player;
	}
	
	public String play(){
		try {
			return player.play();
		} catch (EmptyTrackListException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		return null;
	}
	
	public String stop(){
		try {
			return player.stop();
		} catch (EmptyTrackListException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		return null;
	}
	
	public String next(){
		try {
			return player.next();
		} catch (EmptyTrackListException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		return null;
	}
	
	@Override
	public HomeDeviceStatus turnOn(){
			return player.turnOn();
	}

	@Override
	public HomeDeviceStatus turnOff() {
			return player.turnOff();
	}
	
	@Override
	public String getDeviceId() {
		return player.getDeviceId();
	}
}
